import http from '@/utils/axios'
export default {
  updateLayoutList(pram) {
    return http({
      url: `/management-portal/layout/update`,
      method: 'post',
      data: pram,
    })
  },
  saveLayoutList(pram) {
    return http({
      url: `/management-portal/layout/add`,
      method: 'post',
      data: pram,
    })
  },
  deletLayoutList(pram) {
    return http({
      url: `/management-portal/layout/delete?id=${pram}`,
      method: 'post',
    })
  },
  searchLayoutList(pram) {
    let ul = ''
    if (pram.label) {
      ul += `&label=${pram.label}`
    }
    if (pram.name) {
      ul += `&name=${pram.name}`
    }
    return http({
      url: `/management-portal/layout/getList?pageNo=${pram.pageNo}&pageSize=${pram.pageSize}` + ul,
      method: 'get',
    })
  },
  getALiYunInfo() {
    return http({
      url: `/management-portal/storage/getPostSignature?fileType=image&storageType=oss`,
      method: 'get',
    })
  },
  uploadImg(host, pram) {
    return http({
      url: host,
      method: 'post',
      data: pram,
    })
  },
  getImg(host, key) {
    return http({
      url: host,
      method: 'get',
      header: { Authorization: key },
    })
  },
}
